<template>
  <div id="search">
    <el-input v-model="queryInfo.query" style="width: 350px;" placeholder="用户名 - 支持模糊查询" class="filter-item" clearable @keyup.enter.native="filter" />
    <el-button class="filter-item" icon="el-icon-search" @click="filter" />
  </div>

</template>

<script>
export default {
  name: 'SearchItem',
  props: {

  },
  data() {
    return {
      // 获取用户列表的参数对象
      queryInfo: {
        query: ''
      }
    }
  },
  methods: {
    filter() {
      // $emit('自定义方法名', 要传递的数据)
      this.$emit('filter', this.queryInfo)
    }
  }
}
</script>

